package cn.edu.imau.zy.system.feign;

import cn.edu.imau.zy.common.constant.ServiceNameConstants;
import cn.edu.imau.zy.common.core.domain.R;
import cn.edu.imau.zy.common.core.entity.activiti.BizBusiness;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * 用户 Feign服务层
 * 
 * @author zmr
 * @date 2019-05-20
 */
@FeignClient(name = ServiceNameConstants.ACTIVITI_SERVICE)
public interface RemoteActivitiService
{
    /**
     * 获取最新版流程信息
     * @param key
     * @return
     */
    @GetMapping("prof/oneLatest/{key}")
    Map<String,String> oneLatest(@PathVariable("key") String key);

    /**
     * 启动业务流程
     */
    @PostMapping("business/start")
    R startProcess(@RequestBody BizBusiness business);

    /**
     * 查询流程业务
     */
    @GetMapping("business/get/{id}")
    BizBusiness getBizBusinessById(@PathVariable("id") String id);

    /**
     * 查询流程业务
     */
    @GetMapping("business/getMap/{ids}")
    Map<String,BizBusiness> getBizBusinessByTableIds(@PathVariable("ids") String id);
}
